package so.sao.code.service.infrastructure.enums;

import so.sao.top.core.util.enums.NamedEnumEntity;

/**
 * Created by Administrator on 2017/6/29.
 */
public enum TagRangeStatus implements NamedEnumEntity<Integer> {
    UNACTIVATE(10, "未激活"), ACTIVATED(20, "已激活");

    private Integer value;

    private String name;

    TagRangeStatus(Integer value, String name) {
	this.name = name;
	this.value = value;
    }

    @Override
    public Integer getValue() {
	return value;
    }

    @Override
    public String getName() {
	return name;
    }

	public static TagRangeStatus fromValue(Integer value) {
		switch (value) {
		case 10:
			return TagRangeStatus.UNACTIVATE;
		case 20:
			return TagRangeStatus.ACTIVATED;
		default:
			throw new IllegalArgumentException("Value [" + value + "] not support!");
		}
	}
}
